#ifndef RELATIONEDITOR_H
#define RELATIONEDITOR_H

#include <QDialog>

#include "uml/class/umlcardinality.h"

class UmlRelation;
class UmlRelationalItem;
class UmlClassDiagramm;
class UmlClassItem;

namespace Ui {
    class RelationEditor;
}

class RelationEditor : public QDialog {
    Q_OBJECT
public:
    RelationEditor(QWidget *parent = 0);
    ~RelationEditor();

    void setRelation(UmlRelation *relation);

protected:
    void changeEvent(QEvent *e);

    Ui::RelationEditor *ui;

    UmlRelation *_relation;

    UmlClassDiagramm *_scene;
    UmlClassItem *_item1;
    UmlClassItem *_item2;
    UmlRelation *_previewRelation;

private slots:
    void save();
    void cancel();
    void updatePreview();
};

#endif // RELATIONEDITOR_H
